package sensores;

import java.util.ArrayList;
import java.util.List;

import utils.Alarmas;
import vos.Dispositivo;

public class SensorTemperatura extends Sensor {
	
	private List alarmas;
	private int indexList = -1;
	
	public SensorTemperatura(){
		alarmas = new ArrayList();
		this.rango(0.1,0.8);
	}
	
	public boolean activar(){
		System.out.println("Sensor de Temperatura prendido");
		return true;
	}
	
	public boolean desactivar(){
		System.out.println("Sensor de Temperatura Detenido");
		return true;
	}
	
	public boolean accion(){
		boolean state = true;
		double valorMuestra = Math.random();
		if(valorMuestra < this.getRangoMenor() || valorMuestra > this.getRandoMayor()){
			state = false;
		}
		state = false;
		System.out.println("El estado del sensor de Temperatura es: "+state);
		return state;
	}
	
	public void setAlarmas(String alarmasName){
		this.alarmas.add(alarmasName);
	}
	
	public void setListAlarmas(List alarmasList){
		this.alarmas = alarmasList;
	}
	
	public String getAlarma(){
		this.indexList++;
		return this.alarmas.get(indexList).toString();
	}
	
	public int getSize(){
		return this.alarmas.size();
	}
	

	public void setInitSize(){
		this.indexList = -1;
	}
	
	public Dispositivo getAlarmas(String name){
		return null;
	}
}
